package rpc.frame.server.boot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import rpc.frame.server.registry.RpcRegistry;

import javax.annotation.Resource;

@Configuration
public class FrameServerRunner {


    @Resource
    private RpcRegistry rpcRegistry;

    @Resource
    private  FrameServer frameServer;

    /**
     * PostConstruct 初始化启动注解
     * 初始化
     * 1、像zookeeper 服务注册
     * 2、netty 网络通信
     *    收到服务端信息后一次解码、二次解码
     *    返回服务端信息加码、二次加码
     */
    public void run(){
        //开启服务注册
        rpcRegistry.serviceRegistry();
        //启动netty 网络通信模块
        frameServer.start();
    }


}
